	<?php use_helper('JavascriptBase'); ?>
	<div id="searcher"> 
	
		<div id="slider">
			<img class="slideShow" src="/fotos/sliderHome/1-aiguablava.jpg" alt="Plage D'Aiguablava, Begur" border='0px'/>
			</div>

		<h1>Cherchez votre logement pour vos prochaines vacances &agrave; Costa Brava:</h1>
		<form class="searcherForm" action="<?php echo url_for('searcher/activeLocations') ?>" method="GET">
			<div class="formComponent"><?php echo $form['from_date']->renderRow(array('id'=>'datepicker')) ?></div>
			<div class="formComponent"><?php echo $form['semaines']->renderRow() ?></div>
			<div class="formComponent"><?php echo $form['personnes']->renderRow() ?></div>
			<div class="formComponent"><?php echo $form['appt_villa']->renderRow() ?></div>
			<div class="formComponent"><?php echo $form['piscine']->renderRow() ?></div>
			<input type="hidden" name="crit" value="<?php echo $sf_params->get('crit') ?>" />
			<input type="hidden" name="order" value="<?php echo $sf_params->get('order') ?>" />
			<label for="prix">&nbsp;</label>
			<div class="formSubmit"><input type="submit" value="Chercher"/></div>

		
				<script type="text/javascript">
					jQuery(function() {
				jQuery("#datepicker").datepicker({ minDate: new Date(<?php echo $startDateSearcher[2] ?>, <?php echo $startDateSearcher[1]-1 ?>, <?php echo $startDateSearcher[0] ?>), beforeShowDay: jQuery.datepicker.onlyWeekends, showOn: "button", buttonImage: "/images/calendar.png", buttonImageOnly: true, dateFormat: "dd-mm-yy", numberOfMonths: 3,
			stepMonths: 3, showButtonPanel: true, firstDay: 1, buttonText: 'Calendrier'
			});
			jQuery.datepicker.setDefaults(jQuery.datepicker.regional['fr']);
					});
					
				</script>
		</form>
		</div>
		<div id="nbResults"><?php echo $pager->getNbResults() ?> logements. <?php echo $pager->getFirstIndice() ?> - <?php echo $pager->getLastIndice() ?></div>
		<?php if ($pager->haveToPaginate()): ?>
		<div class="pagination-searcher-top-home">
<ul class="pagination-flickr">
  
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <li>
	<a 
	<?php if ($sf_params->get('page')==$page): ?>
		class='active'
	<?php endif ?>	
		href="<?php echo url_for('searcher') ?>/<?php echo $page ?>/<?php echo $sf_params->get('personnes')?>/<?php echo $sf_params->get('semaines') ?>/<?php echo $sf_params->get('appt_villa') ?>/<?php echo $sf_params->get('piscine') ?>/<?php echo str_replace("-", "_", $sf_params->get('from_date')) ?>/<?php echo $sf_params->get('crit') ?>/<?php echo $sf_params->get('order') ?>">
    <?php echo $page ?></a>
	</li>
  <?php endforeach ?>
 	
</ul>
</div>
	<?php endif ?>	
	
<div style="float:left;">
	<?php foreach($pager->getResults() as $vivienda): ?>
		<div class="post">
				<div id="minimumPrice">
				<?php if($vivienda->getPrecioMin() != 0 && $vivienda->getPrecioMin() < 99999): ?>
				&Agrave; partir de <?php echo ViviendaAlquiler::viviendaPrecioConComision($vivienda->getPrecioMin()); ?>&#8364;/semaine
				<?php endif ?>
				</div>	
				<h1 style="text-decoration: underline;"><?php echo link_to(ucwords($vivienda->getSlug())." ".$vivienda->getId(), 'location_show', $vivienda) ?></h1>
				
				<?php if (count(sfFinder::type('file')->name($vivienda->getNombre().'100x75-1.jpg')->in(sfConfig::get('app_fotos_cache'))) != 0): ?>
				<p><?php echo link_to(image_tag('/cache/'.$vivienda->getNombre().'100x75-1.jpg', 'class=float-left width=100 height=75 alt='.ucwords($vivienda->getSlug()).' '.$vivienda->getId()), 'location_show', $vivienda) ?></p>
				<?php else: ?>
				<p><?php echo link_to(image_tag('/fotos/oficina1.jpg', 'class=float-left width=100 height=75 alt='.ucwords($vivienda->getSlug()).' '.$vivienda->getId()), 'location_show', $vivienda) ?></p>
				<?php endif; ?><p><?php include_component('location', 'viviendaDescription', array('vivienda'=>$vivienda)) ?></p>
				<p><?php echo str_ireplace($vivienda->getAlias(), $vivienda->getId(),  $vivienda->getDesc_brev_fr()); ?></p>
				<p class="post-footer"><?php include_component('location', 'viviendaFeatures', array('vivienda'=>$vivienda)) ?></p>
			</div>
			<?php endforeach ?>	
</div>
						
		
	<?php if ($pager->haveToPaginate()): ?>
		<div class="pagination-searcher-bottom-home">
	<ul class="pagination-flickr">
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <li>
	<a 
	<?php if ($sf_params->get('page')==$page): ?>
		class='active'
	<?php endif ?>	
		href="<?php echo url_for('searcher') ?>/<?php echo $page ?>/<?php echo $sf_params->get('personnes')?>/<?php echo $sf_params->get('semaines') ?>/<?php echo $sf_params->get('appt_villa') ?>/<?php echo $sf_params->get('piscine') ?>/<?php echo str_replace("-", "_", $sf_params->get('from_date')) ?>/<?php echo $sf_params->get('crit') ?>/<?php echo $sf_params->get('order') ?>">
    <?php echo $page ?></a>
	</li>
  <?php endforeach ?>
</ul>
</div>
	<?php endif ?>	

